import {Component, Input} from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import {ContentCardModel} from "../../model/content-card-model";
import {AppService} from "../../services/AppService";

/*
  Generated class for the TimeLine page.

  See http://ionicframework.com/docs/v2/components/#navigation for more info on
  Ionic pages and navigation.
*/
@Component({
  selector: 'time-line',
  templateUrl: 'time-line.html'
})
export class TimeLine {

  @Input()
  model: Array<ContentCardModel> = [];

  constructor(public navCtrl: NavController, public navParams: NavParams, private appService: AppService) {}


  public fetch()
  {
    this.appService.getTimeline().then(timeline => {
      this.model = timeline;
    });

  }
}
